package com.es.disped.dao.oj.mapper;

import com.es.disped.dao.oj.model.Mail;
import com.es.disped.dao.oj.model.MailExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface MailMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @SelectProvider(type=MailSqlProvider.class, method="countByExample")
    long countByExample(MailExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @DeleteProvider(type=MailSqlProvider.class, method="deleteByExample")
    int deleteByExample(MailExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Delete({
        "delete from mail",
        "where mail_id = #{mailId,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer mailId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Insert({
        "insert into mail (mail_id, to_user, ",
        "from_user, title, ",
        "new_mail, reply, in_date, ",
        "defunct, content)",
        "values (#{mailId,jdbcType=INTEGER}, #{toUser,jdbcType=VARCHAR}, ",
        "#{fromUser,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, ",
        "#{newMail,jdbcType=BIT}, #{reply,jdbcType=TINYINT}, #{inDate,jdbcType=TIMESTAMP}, ",
        "#{defunct,jdbcType=CHAR}, #{content,jdbcType=LONGVARCHAR})"
    })
    int insert(Mail record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @InsertProvider(type=MailSqlProvider.class, method="insertSelective")
    int insertSelective(Mail record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @SelectProvider(type=MailSqlProvider.class, method="selectByExampleWithBLOBs")
    @Results({
        @Result(column="mail_id", property="mailId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="to_user", property="toUser", jdbcType=JdbcType.VARCHAR),
        @Result(column="from_user", property="fromUser", jdbcType=JdbcType.VARCHAR),
        @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
        @Result(column="new_mail", property="newMail", jdbcType=JdbcType.BIT),
        @Result(column="reply", property="reply", jdbcType=JdbcType.TINYINT),
        @Result(column="in_date", property="inDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="defunct", property="defunct", jdbcType=JdbcType.CHAR),
        @Result(column="content", property="content", jdbcType=JdbcType.LONGVARCHAR)
    })
    List<Mail> selectByExampleWithBLOBs(MailExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @SelectProvider(type=MailSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="mail_id", property="mailId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="to_user", property="toUser", jdbcType=JdbcType.VARCHAR),
        @Result(column="from_user", property="fromUser", jdbcType=JdbcType.VARCHAR),
        @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
        @Result(column="new_mail", property="newMail", jdbcType=JdbcType.BIT),
        @Result(column="reply", property="reply", jdbcType=JdbcType.TINYINT),
        @Result(column="in_date", property="inDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="defunct", property="defunct", jdbcType=JdbcType.CHAR)
    })
    List<Mail> selectByExample(MailExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Select({
        "select",
        "mail_id, to_user, from_user, title, new_mail, reply, in_date, defunct, content",
        "from mail",
        "where mail_id = #{mailId,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="mail_id", property="mailId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="to_user", property="toUser", jdbcType=JdbcType.VARCHAR),
        @Result(column="from_user", property="fromUser", jdbcType=JdbcType.VARCHAR),
        @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
        @Result(column="new_mail", property="newMail", jdbcType=JdbcType.BIT),
        @Result(column="reply", property="reply", jdbcType=JdbcType.TINYINT),
        @Result(column="in_date", property="inDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="defunct", property="defunct", jdbcType=JdbcType.CHAR),
        @Result(column="content", property="content", jdbcType=JdbcType.LONGVARCHAR)
    })
    Mail selectByPrimaryKey(Integer mailId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @UpdateProvider(type=MailSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") Mail record, @Param("example") MailExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @UpdateProvider(type=MailSqlProvider.class, method="updateByExampleWithBLOBs")
    int updateByExampleWithBLOBs(@Param("record") Mail record, @Param("example") MailExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @UpdateProvider(type=MailSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Mail record, @Param("example") MailExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @UpdateProvider(type=MailSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Mail record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Update({
        "update mail",
        "set to_user = #{toUser,jdbcType=VARCHAR},",
          "from_user = #{fromUser,jdbcType=VARCHAR},",
          "title = #{title,jdbcType=VARCHAR},",
          "new_mail = #{newMail,jdbcType=BIT},",
          "reply = #{reply,jdbcType=TINYINT},",
          "in_date = #{inDate,jdbcType=TIMESTAMP},",
          "defunct = #{defunct,jdbcType=CHAR},",
          "content = #{content,jdbcType=LONGVARCHAR}",
        "where mail_id = #{mailId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKeyWithBLOBs(Mail record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Update({
        "update mail",
        "set to_user = #{toUser,jdbcType=VARCHAR},",
          "from_user = #{fromUser,jdbcType=VARCHAR},",
          "title = #{title,jdbcType=VARCHAR},",
          "new_mail = #{newMail,jdbcType=BIT},",
          "reply = #{reply,jdbcType=TINYINT},",
          "in_date = #{inDate,jdbcType=TIMESTAMP},",
          "defunct = #{defunct,jdbcType=CHAR}",
        "where mail_id = #{mailId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Mail record);
}